[Top] [Prev] [Next] [Bottom]
[Contents]
Creating the Book Query Bindings
If you select an item from the pull-down menu and click Select
, you will get an error message. There is not yet a binding associated with this form, so you will now create one.
- 1. Open the Object Bind Editor (New Activator).
- 2. Choose books.html as the
Document
.
- 3. Select
BookForm
as the activator. Click Ok
.
- Note: For each HTML document you choose in the Activator Selector, you should choose either a Form or an Anchor activator.
- 4. Choose
DSQL
as the Object Type
.
- 5. Select the appropriate server.
- 6. Select
pubs2
database.
- 7. Select
BD_Title_By_Title_And_Type
from the DSQL Name
list. Click Ok
.
- 8. The DSQL object you have selected requires two arguments. In the
Arguments<=>Activator
section of the window, click the down arrow next to the argument name title
and select the argument value TitleText
.
- 9. Click the text field next to the second argument and select
CategoryOption
as the argument value for the argument name Category
.
![](ch4a7.gif)
Figure 4-8 Object Bind Editor
- 10. Now that the input arguments have been specified, it remains to define the output of the binding. In the
Results<=>Template
section, select book_results.html.
- 11. For the result column
title_id
select the data site TitleHotList
.
- 12. For the result column
varchar
select the data site TitleHotList
.
- You may have noticed that you are telling the tool to place two database result columns (
title_id
and title
) in the same data drop site (TitleHotList
). Sapphire/Web automatically handles situations where multiple results are placed in the same data drop site. Because of this special handling, you will select only one population method from the Results Detail Editor for all occurrences of TitleHotList
.
- 13. Click the Results Detail Editor button found to the right of the
TitleHotList
selection.
- 14. Select
SaPopulateHotList
from the Callback
combo box and click Ok
. You will not have to select a population method for the other result column
- 15. Click
Ok
to save your changes and close the Object Bind Editor.
- 16. Now that these changes are complete, click the
Test
icon.
Testing the Book Query Bindings
- Your browser will display the first page of the project. Click
Book Search
. At the Book Query page (Fig. 4-9), enter %
in the Title
text field (% is the SQL wild card). Pull down the Category
menu and select a category. Click Submit Query
.
Figure 4-9 Book Query page
The results you see in book_results.html (Fig. 4-10) are based on the two arguments ("%" and "business", for example) you supplied to the BD_Title_By_Title_And_Type
DSQL object.
Figure 4-10 Book Results page-selected "business"
Notice that each item listed is a book title that comes from your database. Also notice that they are all hyperlinks because you chose to populate a Hotlist. The links currently point to nothing at present, but you will soon bind the Hotlist entries to associated Book Detail pages.
[Top] [Prev] [Next] [Bottom]
[Contents]
info@bluestone.com
Copyright © 1997, Bluestone. All rights
reserved.